﻿package com.tudou.ad
{
    import com.tudou.track.*;

    public class TdAdVideo extends AdVideoBase implements IAdVideoView
    {
        protected var _tracker:IAdTracker;

        public function TdAdVideo(param1:uint, param2:uint)
        {
            super(param1, param2);
            return;
        }// end function

        override protected function videoRequestError() : void
        {
            sendTrack(NodeLog.AD_VIDEO_REQUEST_ERROR);
            return;
        }// end function

        override protected function videoEffectiveShow() : void
        {
            sendTrack(NodeLog.AD_VIDEO_EFFECTIVE_SHOW);
            return;
        }// end function

        override protected function videoBuffer5Skip() : void
        {
            sendTrack(NodeLog.AD_VIDEO_BUFFER5_SKIP);
            return;
        }// end function

        override protected function videoLoadComplete() : void
        {
            sendTrack(NodeLog.AD_VIDEO_LOAD_COMPLETE);
            return;
        }// end function

        override protected function videoUrlNull() : void
        {
            sendTrack(NodeLog.AD_VIDEO_URL_NULL);
            return;
        }// end function

        override protected function videoSubRequestError() : void
        {
            sendTrack(NodeLog.AD_VIDEO_SUB_REQUEST_ERROR);
            return;
        }// end function

        protected function sendTrack(param1:String, param2:Array = null) : void
        {
            if (!_tracker)
            {
                return;
            }
            _tracker.adSend(adItemInfo, adThrowInfo, param1, param2);
            return;
        }// end function

        override protected function videoPlayComplete() : void
        {
            sendTrack(NodeLog.AD_VIDEO_PLAY_COMPLETE);
            return;
        }// end function

        override protected function videoBuffer() : void
        {
            sendTrack(NodeLog.AD_VIDEO_BUFFER);
            return;
        }// end function

        override protected function videoRequestComplete() : void
        {
            sendTrack(NodeLog.AD_VIDEO_REQUEST_COMPLETE);
            return;
        }// end function

        override protected function videoRequestStart() : void
        {
            sendTrack(NodeLog.AD_VIDEO_REQUEST_START);
            return;
        }// end function

        public function set tracker(param1:IAdTracker) : void
        {
            _tracker = param1;
            return;
        }// end function

        override protected function videoRequestTimeout() : void
        {
            sendTrack(NodeLog.AD_VIDEO_REQUEST_TIMEOUT);
            return;
        }// end function

        override protected function clearComps() : void
        {
            super.clearComps();
            _tracker = null;
            return;
        }// end function

        override protected function videoSubRequestStart() : void
        {
            sendTrack(NodeLog.AD_VIDEO_SUB_REQUEST_START);
            return;
        }// end function

        override protected function videoPlayheadtime() : void
        {
            sendTrack(NodeLog.AD_VIDEO_PLAYHEADTIME, [playheadTime]);
            return;
        }// end function

    }
}
